package dto;
// Generated Mar 20, 2013 5:08:51 PM by Hibernate Tools 3.2.1.GA

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 * Image generated by hbm2java
 */
@Entity
@Table(name = "Image", schema = "dbo", catalog = "AntiqueShop")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="image", namespace="http://xml.netbeans.org/schema/image")
public class Image implements java.io.Serializable {
    @XmlAttribute(name="id", required=true, namespace="http://xml.netbeans.org/schema/image")
    private int id;
    @XmlTransient
    private Product product;
    @XmlElement(name="name", required=true, namespace="http://xml.netbeans.org/schema/image")
    private String name;
    @XmlElement(name="description", required=true, namespace="http://xml.netbeans.org/schema/image")
    private String description;
    @XmlElement(name="url", required=true, namespace="http://xml.netbeans.org/schema/image")
    private String url;
    @XmlElement(name="isbigsize", required=false, namespace="http://xml.netbeans.org/schema/image")
    private Boolean isBigsize;

    public Image() {
    }

    public Image(int id, Product product, String name, String description, String url) {
        this.id = id;
        this.product = product;
        this.name = name;
        this.description = description;
        this.url = url;
    }

    public Image(int id, Product product, String name, String description, String url, Boolean isBigsize) {
        this.id = id;
        this.product = product;
        this.name = name;
        this.description = description;
        this.url = url;
        this.isBigsize = isBigsize;
    }

    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "product_id", nullable = true)
    public Product getProduct() {
        return this.product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @Column(name = "name", nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "description", nullable = false)
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "url", nullable = false)
    public String getUrl() {
        return this.url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Column(name = "is_bigsize")
    public Boolean getIsBigsize() {
        return this.isBigsize;
    }

    public void setIsBigsize(Boolean isBigsize) {
        this.isBigsize = isBigsize;
    }
}
